package com.interceptor;

//代理类
import java.lang.reflect.Proxy;

public class MyProxy {

	public Object getProxy(Object object) {//传来目标对象
		MyHandler myHandler = new MyHandler();
		myHandler.setObject(object);
		// 动态代理
		return Proxy.newProxyInstance(Target.class.getClassLoader(), object
				.getClass().getInterfaces(), myHandler);
	}
}
